package org.example.module_login.controller;


import org.example.module_login.entity.Teacher;
import org.example.module_login.service.TeacherService;
import org.example.module_login.utlis.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;


/**
 * 教师表(Teacher)表控制层
 *
 * @author HAJ
 * @since 2025-03-03 15:14:34
 */
@RestController
@RequestMapping("")
@CrossOrigin
public class TeacherController {

    @Autowired
    public TeacherService service;

    /**
     * 登录
     * */
    @PostMapping("/login")
    public R login(@RequestBody Teacher teacher, HttpServletResponse response){
        return service.login(teacher,response);
    }

    /**
     * 注册
     * */
    @PostMapping("/register")
    public R register(@RequestBody Teacher teacher){
        return service.register(teacher);
    }

}

